package com.hao.demo1;
// 创建线程方法2：实现Runnable接口，重写run方法
public class TestThread3 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println("我在学校"+i);
        }
    }

    public static void main(String[] args) {

        TestThread3 testThread3 = new TestThread3();
        new Thread(testThread3).start();

        for (int i = 0; i < 20; i++) {
            System.out.println("学习Java多线程"+i);
        }
    }
}
